﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MusicExplorer.Data;
using MusicExplorer.WebRepository.Interface;
using MusicExplorer.WebRepository.Service;

namespace MusicExplorer.WebRepository
{
    public sealed class FavoriteTracksWebRepository : WebRepositoryBase,
        ITrackListingWebRepository
    {
        public FavoriteTracksWebRepository()
        {
            m_web_repository = ServiceWebRepository.GetWebRepository(null, this.GetType().Name);
            m_result_per_page = 0;
        }

        public async Task<List<TRACK>> GetTracksAsync(WebClient webClient, CancellationToken token, int page)
        {
            if (page == 1)
                return await Task.Factory.StartNew(() => ServiceWebRepository.GetFavoriteTracks());
            else return null;
        }
    }
}
